!     Copyright (C) 2010 Benjamin Piaud
!
!     LIMBES is free software; you can redistribute it and/or modify
!     it under the terms of the GNU General Public License as published by
!     the Free Software Foundation; either version 3, or (at your option)
!     any later version.

!     LIMBES is distributed in the hope that it will be useful,
!     but WITHOUT ANY WARRANTY; without even the implied warranty of
!     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
!     GNU General Public License for more details.

!     You should have received a copy of the GNU General Public License
!     along with LIMBES; if not, see <http://www.gnu.org/licenses/>

!     the subroutine LIMBES_dvm computes:
!     LIMBES_v(1:LIMBES_nv) -> discrete velocities (real*8)
!     LIMBES_w(1:LIMBES_nv) -> associated weights (real*8)
!     LIMBES_feq0(1:LIMBES_nv) -> reference equilibrium distribution function (real*8)
!     LIMBES_vi(1:LIMBES_nv) -> associated indices (integer*8)
!     LIMBES_antiv(1:LIMBES_nv) -> associated opposite indices (integer*8)

subroutine LIMBES_dvm()
  use LIMBES_mod_var
  use LIMBES_mod_fluid_config
  implicit none
  integer*8 :: vi,vi1,vix,viy,nvi
  integer*8,allocatable :: vi_ind(:),antivi_ind(:)
  integer*8,allocatable :: vix_ind(:),viy_ind(:)
  integer*8,allocatable :: antivix_ind(:),antiviy_ind(:) 
  real*8,allocatable :: vv(:),ww(:),feq0(:)


  LIMBES_nv=SIMUL_Nquad**two

  allocate(vi_ind(1:SIMUL_Nquad))
  allocate(antivi_ind(1:SIMUL_Nquad))
  allocate(vix_ind(1:LIMBES_nv))
  allocate(viy_ind(1:LIMBES_nv))
  allocate(antivix_ind(1:LIMBES_nv))
  allocate(antiviy_ind(1:LIMBES_nv))
  allocate(vv(1:SIMUL_Nquad))
  allocate(ww(1:SIMUL_Nquad))
  allocate(feq0(1:SIMUL_Nquad))

  call GaussHermite(SIMUL_Nquad,vv,ww)

  nvi=SIMUL_Nquad/2
  do vi=1,SIMUL_Nquad
     !     discrete velocities and associated weights
     vv(vi)=vv(vi)*dsqrt(2.0D+0*FLUID_RT0)
     ww(vi)=ww(vi)*dexp(vv(vi)*vv(vi)/(2.0D+0*FLUID_RT0))*dsqrt(2.0D+0*FLUID_RT0)
     feq0(vi)=dexp(-vv(vi)*vv(vi)/(2.0D+0*FLUID_RT0))/dsqrt(2.0D+0*pi*FLUID_RT0)
     !     dicrete veloicities indices and their opposite
     !         vi_ind(vi)=nvi
     vi_ind(vi)=vi
     antivi_ind(vi)=SIMUL_Nquad+1-vi
     nvi=nvi - 1               
  enddo

  vi=0
  do vix=1,SIMUL_Nquad
     do viy=1,SIMUL_Nquad
        vi=vi+1
        LIMBES_vx(vi)=vv(vix)
        LIMBES_vy(vi)=vv(viy)
        LIMBES_w(vi)=ww(vix)*ww(viy)
        LIMBES_feq0(vi)=feq0(vix)*feq0(viy)
        vix_ind(vi)=vi_ind(vix)
        antivix_ind(vi)=antivi_ind(vix)
        viy_ind(vi)=vi_ind(viy)
        antiviy_ind(vi)=antivi_ind(viy)
     enddo
  enddo

  do vi=1,LIMBES_nv
     do vi1=1,LIMBES_nv
        if (vix_ind(vi1).EQ.antivix_ind(vi).AND.viy_ind(vi1).EQ.antiviy_ind(vi)) LIMBES_opposite_v(vi)=vi1
        if (vix_ind(vi1).EQ.antivix_ind(vi).AND.viy_ind(vi1).EQ.viy_ind(vi)) LIMBES_opposite_vx(vi)=vi1
        if (vix_ind(vi1).EQ.vix_ind(vi).AND.viy_ind(vi1).EQ.antiviy_ind(vi)) LIMBES_opposite_vy(vi)=vi1
     enddo
  enddo

  deallocate(vi_ind)
  deallocate(antivi_ind)
  deallocate(vix_ind)
  deallocate(viy_ind)
  deallocate(antivix_ind)
  deallocate(antiviy_ind)
  deallocate(vv)
  deallocate(ww)
  deallocate(feq0)

end subroutine LIMBES_dvm

!-----------------------------------------------------------------------------
!-----------------------------------------------------------------------------
!-----------------------------------------------------------------------------

subroutine GaussHermite(Nq,vv,ww)
  implicit none
  integer*8 :: Nq
  real*8 :: vv(1:Nq), ww(1:Nq)


  if (Nq.EQ.3) then
 vv(  1 )=   1.2247448713915892     
 vv(  2 )=   0.0000000000000000     
 vv(  3 )=  -1.2247448713915892     
 ww(  1 )=  0.29540897515091652     
 ww(  2 )=   1.1816359006036801     
 ww(  3 )=  0.29540897515091652
  elseif (Nq.EQ.4) then
 vv(  1 )=   1.6506801238857844     
 vv(  2 )=  0.52464762327529035     
 vv(  3 )= -0.52464762327529035     
 vv(  4 )=  -1.6506801238857844     
 ww(  1 )=  8.13128354472445053D-002
 ww(  2 )=  0.80491409000550562     
 ww(  3 )=  0.80491409000550562     
 ww(  4 )=  8.13128354472445053D-002
  elseif (Nq.EQ.5) then
vv(  1 )=   2.0201828704560856     
 vv(  2 )=  0.95857246461381851     
 vv(  3 )=   0.0000000000000000     
 vv(  4 )= -0.95857246461381851     
 vv(  5 )=  -2.0201828704560856     
 ww(  1 )=  1.99532420590457400D-002
 ww(  2 )=  0.39361932315223769     
 ww(  3 )=  0.94530872048294401     
 ww(  4 )=  0.39361932315223769     
 ww(  5 )=  1.99532420590457400D-002
  elseif (Nq.EQ.6) then
 vv(  1 )=   2.3506049736744923     
 vv(  2 )=   1.3358490740136970     
 vv(  3 )=  0.43607741192761651     
 vv(  4 )= -0.43607741192761651     
 vv(  5 )=  -1.3358490740136970     
 vv(  6 )=  -2.3506049736744923     
 ww(  1 )=  4.53000990550879966D-003
 ww(  2 )=  0.15706732032285511     
 ww(  3 )=  0.72462959522438597     
 ww(  4 )=  0.72462959522438597     
 ww(  5 )=  0.15706732032285511     
 ww(  6 )=  4.53000990550879966D-003
  elseif (Nq.EQ.7) then
 vv(  1 )=   2.6519613568352334     
 vv(  2 )=   1.6735516287674714     
 vv(  3 )=  0.81628788285896470     
 vv(  4 )=   0.0000000000000000     
 vv(  5 )= -0.81628788285896470     
 vv(  6 )=  -1.6735516287674714     
 vv(  7 )=  -2.6519613568352334     
 ww(  1 )=  9.71781245099502229D-004
 ww(  2 )=  5.45155828191265374D-002
 ww(  3 )=  0.42560725261012383     
 ww(  4 )=  0.81026461755680912     
 ww(  5 )=  0.42560725261012383     
 ww(  6 )=  5.45155828191265374D-002
 ww(  7 )=  9.71781245099502229D-004
  elseif (Nq.EQ.8) then
vv(  1 )=   2.9306374202572441     
 vv(  2 )=   1.9816567566958430     
 vv(  3 )=   1.1571937124467802     
 vv(  4 )=  0.38118699020732216     
 vv(  5 )= -0.38118699020732216     
 vv(  6 )=  -1.1571937124467802     
 vv(  7 )=  -1.9816567566958430     
 vv(  8 )=  -2.9306374202572441     
 ww(  1 )=  1.99604072211365748D-004
 ww(  2 )=  1.70779830074132763D-002
 ww(  3 )=  0.20780232581489003     
 ww(  4 )=  0.66114701255823527     
 ww(  5 )=  0.66114701255823527     
 ww(  6 )=  0.20780232581489003     
 ww(  7 )=  1.70779830074132763D-002
 ww(  8 )=  1.99604072211365748D-004
  elseif (Nq.EQ.9) then
vv(  1 )=   3.1909932017815272     
 vv(  2 )=   2.2665805845318432     
 vv(  3 )=   1.4685532892166679     
 vv(  4 )=  0.72355101875283756     
 vv(  5 )=   0.0000000000000000     
 vv(  6 )= -0.72355101875283756     
 vv(  7 )=  -1.4685532892166679     
 vv(  8 )=  -2.2665805845318432     
 vv(  9 )=  -3.1909932017815272     
 ww(  1 )=  3.96069772632639175D-005
 ww(  2 )=  4.94362427553689514D-003
 ww(  3 )=  8.84745273943757932D-002
 ww(  4 )=  0.43265155900255170     
 ww(  5 )=  0.72023521560605253     
 ww(  6 )=  0.43265155900255170     
 ww(  7 )=  8.84745273943757932D-002
 ww(  8 )=  4.94362427553689514D-003
 ww(  9 )=  3.96069772632639175D-005
  elseif (Nq.EQ.10) then
 vv(  1 )=   3.4361591188377374     
 vv(  2 )=   2.5327316742327897     
 vv(  3 )=   1.7566836492998819     
 vv(  4 )=   1.0366108297895136     
 vv(  5 )=  0.34290132722370459     
 vv(  6 )= -0.34290132722370459     
 vv(  7 )=  -1.0366108297895136     
 vv(  8 )=  -1.7566836492998819     
 vv(  9 )=  -2.5327316742327897     
 vv( 10 )=  -3.4361591188377374     
 ww(  1 )=  7.64043285523253257D-006
 ww(  2 )=  1.34364574678122288D-003
 ww(  3 )=  3.38743944554806831D-002
 ww(  4 )=  0.24013861108231260     
 ww(  5 )=  0.61086263373532013     
 ww(  6 )=  0.61086263373532013     
 ww(  7 )=  0.24013861108231260     
 ww(  8 )=  3.38743944554806831D-002
 ww(  9 )=  1.34364574678122288D-003
 ww( 10 )=  7.64043285523253257D-006

  elseif (Nq.EQ.11) then
vv(  1 )=   3.6684708465595826     
 vv(  2 )=   2.7832900997816519     
 vv(  3 )=   2.0259480158257555     
 vv(  4 )=   1.3265570844949328     
 vv(  5 )=  0.65680956688209979     
 vv(  6 )=   0.0000000000000000     
 vv(  7 )= -0.65680956688209979     
 vv(  8 )=  -1.3265570844949328     
 vv(  9 )=  -2.0259480158257555     
 vv( 10 )=  -2.7832900997816519     
 vv( 11 )=  -3.6684708465595826     
 ww(  1 )=  1.43956039371424693D-006
 ww(  2 )=  3.46819466323341759D-004
 ww(  3 )=  1.19113954449114271D-002
 ww(  4 )=  0.11722787516770751     
 ww(  5 )=  0.42935975235612123     
 ww(  6 )=  0.65475928691459329     
 ww(  7 )=  0.42935975235612123     
 ww(  8 )=  0.11722787516770751     
 ww(  9 )=  1.19113954449114271D-002
 ww( 10 )=  3.46819466323341759D-004
 ww( 11 )=  1.43956039371424693D-006
  elseif (Nq.EQ.12) then
 vv(  1 )=   3.8897248978697818     
 vv(  2 )=   3.0206370251208896     
 vv(  3 )=   2.2795070805010598     
 vv(  4 )=   1.5976826351526048     
 vv(  5 )=  0.94778839124016367     
 vv(  6 )=  0.31424037625435908     
 vv(  7 )= -0.31424037625435908     
 vv(  8 )= -0.94778839124016367     
 vv(  9 )=  -1.5976826351526048     
 vv( 10 )=  -2.2795070805010598     
 vv( 11 )=  -3.0206370251208896     
 vv( 12 )=  -3.8897248978697818     
 ww(  1 )=  2.65855168435626631D-007
 ww(  2 )=  8.57368704358775713D-005
 ww(  3 )=  3.90539058462899703D-003
 ww(  4 )=  5.16079856158834505D-002
 ww(  5 )=  0.26049231026415864     
 ww(  6 )=  0.57013523626247453     
 ww(  7 )=  0.57013523626247453     
 ww(  8 )=  0.26049231026415864     
 ww(  9 )=  5.16079856158834505D-002
 ww( 10 )=  3.90539058462899703D-003
 ww( 11 )=  8.57368704358775713D-005
 ww( 12 )=  2.65855168435626631D-007
  elseif (Nq.EQ.13) then
vv(  1 )=   4.1013375961786398     
 vv(  2 )=   3.2466089783724099     
 vv(  3 )=   2.5197356856782380     
 vv(  4 )=   1.8531076516015121     
 vv(  5 )=   1.2200550365907485     
 vv(  6 )=  0.60576387917106012     
 vv(  7 )=   0.0000000000000000     
 vv(  8 )= -0.60576387917106012     
 vv(  9 )=  -1.2200550365907485     
 vv( 10 )=  -1.8531076516015121     
 vv( 11 )=  -2.5197356856782380     
 vv( 12 )=  -3.2466089783724099     
 vv( 13 )=  -4.1013375961786398     
 ww(  1 )=  4.82573185007307087D-008
 ww(  2 )=  2.04303604027069111D-005
 ww(  3 )=  1.20745999271937277D-003
 ww(  4 )=  2.08627752961697450D-002
 ww(  5 )=  0.14032332068702202     
 ww(  6 )=  0.42161629689853919     
 ww(  7 )=  0.60439318792116303     
 ww(  8 )=  0.42161629689853919     
 ww(  9 )=  0.14032332068702202     
 ww( 10 )=  2.08627752961697450D-002
 ww( 11 )=  1.20745999271937277D-003
 ww( 12 )=  2.04303604027069111D-005
 ww( 13 )=  4.82573185007307087D-008
  elseif (Nq.EQ.14) then
 vv(  1 )=   4.3044485704736317     
 vv(  2 )=   3.4626569336022706     
 vv(  3 )=   2.7484707249854026     
 vv(  4 )=   2.0951832585077170     
 vv(  5 )=   1.4766827311411410     
 vv(  6 )=  0.87871378732939942     
 vv(  7 )=  0.29174551067256210     
 vv(  8 )= -0.29174551067256210     
 vv(  9 )= -0.87871378732939942     
 vv( 10 )=  -1.4766827311411410     
 vv( 11 )=  -2.0951832585077170     
 vv( 12 )=  -2.7484707249854026     
 vv( 13 )=  -3.4626569336022706     
 vv( 14 )=  -4.3044485704736317     
 ww(  1 )=  8.62859116812508753D-009
 ww(  2 )=  4.71648435501887334D-006
 ww(  3 )=  3.55092613551916787D-004
 ww(  4 )=  7.85005472645789425D-003
 ww(  5 )=  6.85055342234645870D-002
 ww(  6 )=  0.27310560906424414     
 ww(  7 )=  0.53640590971208557     
 ww(  8 )=  0.53640590971208557     
 ww(  9 )=  0.27310560906424414     
 ww( 10 )=  6.85055342234645870D-002
 ww( 11 )=  7.85005472645789425D-003
 ww( 12 )=  3.55092613551916787D-004
 ww( 13 )=  4.71648435501887334D-006
 ww( 14 )=  8.62859116812508753D-009
  elseif (Nq.EQ.15) then
 vv(  1 )=   4.4999907073093919     
 vv(  2 )=   3.6699503734044527     
 vv(  3 )=   2.9671669279056032     
 vv(  4 )=   2.3257324861738580     
 vv(  5 )=   1.7199925751864888     
 vv(  6 )=   1.1361155852109206     
 vv(  7 )=  0.56506958325557577     
 vv(  8 )=   0.0000000000000000     
 vv(  9 )= -0.56506958325557577     
 vv( 10 )=  -1.1361155852109206     
 vv( 11 )=  -1.7199925751864888     
 vv( 12 )=  -2.3257324861738580     
 vv( 13 )=  -2.9671669279056032     
 vv( 14 )=  -3.6699503734044527     
 vv( 15 )=  -4.4999907073093919     
 ww(  1 )=  1.52247580425349672D-009
 ww(  2 )=  1.05911554771106014D-006
 ww(  3 )=  1.00004441232499024D-004
 ww(  4 )=  2.77806884291274423D-003
 ww(  5 )=  3.07800338725458221D-002
 ww(  6 )=  0.15848891579593433     
 ww(  7 )=  0.41202868749889493     
 ww(  8 )=  0.56410030872641881     
 ww(  9 )=  0.41202868749889493     
 ww( 10 )=  0.15848891579593433     
 ww( 11 )=  3.07800338725458221D-002
 ww( 12 )=  2.77806884291274423D-003
 ww( 13 )=  1.00004441232499024D-004
 ww( 14 )=  1.05911554771106014D-006
 ww( 15 )=  1.52247580425349672D-009
  elseif (Nq.EQ.16) then
vv(  1 )=   4.6887389393058188     
 vv(  2 )=   3.8694479048601229     
 vv(  3 )=   3.1769991619799560     
 vv(  4 )=   2.5462021578474814     
 vv(  5 )=   1.9517879909162539     
 vv(  6 )=   1.3802585391988809     
 vv(  7 )=  0.82295144914465590     
 vv(  8 )=  0.27348104613815244     
 vv(  9 )= -0.27348104613815244     
 vv( 10 )= -0.82295144914465590     
 vv( 11 )=  -1.3802585391988809     
 vv( 12 )=  -1.9517879909162539     
 vv( 13 )=  -2.5462021578474814     
 vv( 14 )=  -3.1769991619799560     
 vv( 15 )=  -3.8694479048601229     
 vv( 16 )=  -4.6887389393058188     
 ww(  1 )=  2.65480747401114040D-010
 ww(  2 )=  2.32098084486518339D-007
 ww(  3 )=  2.71186009253784142D-005
 ww(  4 )=  9.32284008624164012D-004
 ww(  5 )=  1.28803115355098623D-002
 ww(  6 )=  8.38100413989850135D-002
 ww(  7 )=  0.28064745852853112     
 ww(  8 )=  0.50792947901660901     
 ww(  9 )=  0.50792947901660901     
 ww( 10 )=  0.28064745852853112     
 ww( 11 )=  8.38100413989850135D-002
 ww( 12 )=  1.28803115355098623D-002
 ww( 13 )=  9.32284008624164012D-004
 ww( 14 )=  2.71186009253784142D-005
 ww( 15 )=  2.32098084486518339D-007
 ww( 16 )=  2.65480747401114040D-010
  elseif (Nq.EQ.17) then
vv(  1 )=   4.8713451936744034     
 vv(  2 )=   4.0619466758754745     
 vv(  3 )=   3.3789320911414942     
 vv(  4 )=   2.7577629157038888     
 vv(  5 )=   2.1735028266666210     
 vv(  6 )=   1.6129243142212313     
 vv(  7 )=   1.0676487257434506     
 vv(  8 )=  0.53163300134265468     
 vv(  9 )=   0.0000000000000000     
 vv( 10 )= -0.53163300134265468     
 vv( 11 )=  -1.0676487257434506     
 vv( 12 )=  -1.6129243142212313     
 vv( 13 )=  -2.1735028266666210     
 vv( 14 )=  -2.7577629157038888     
 vv( 15 )=  -3.3789320911414942     
 vv( 16 )=  -4.0619466758754745     
 vv( 17 )=  -4.8713451936744034     
 ww(  1 )=  4.58057893079863937D-011
 ww(  2 )=  4.97707898163073416D-008
 ww(  3 )=  7.11228914002123561D-006
 ww(  4 )=  2.98643286697750413D-004
 ww(  5 )=  5.06734995762748042D-003
 ww(  6 )=  4.09200341497559239D-002
 ww(  7 )=  0.17264829767009540     
 ww(  8 )=  0.40182646947040801     
 ww(  9 )=  0.53091793762486483     
 ww( 10 )=  0.40182646947040801     
 ww( 11 )=  0.17264829767009540     
 ww( 12 )=  4.09200341497559239D-002
 ww( 13 )=  5.06734995762748042D-003
 ww( 14 )=  2.98643286697750413D-004
 ww( 15 )=  7.11228914002123561D-006
 ww( 16 )=  4.97707898163073416D-008
 ww( 17 )=  4.58057893079863937D-011
  elseif (Nq.EQ.18) then
 vv(  1 )=   5.0483640088744668     
 vv(  2 )=   4.2481178735681269     
 vv(  3 )=   3.5737690684862660     
 vv(  4 )=   2.9613775055316069     
 vv(  5 )=   2.3862990891666858     
 vv(  6 )=   1.8355316042616288     
 vv(  7 )=   1.3009208583896175     
 vv(  8 )=  0.77668291926741162     
 vv(  9 )=  0.25826775051909673     
 vv( 10 )= -0.25826775051909673     
 vv( 11 )= -0.77668291926741162     
 vv( 12 )=  -1.3009208583896175     
 vv( 13 )=  -1.8355316042616288     
 vv( 14 )=  -2.3862990891666858     
 vv( 15 )=  -2.9613775055316069     
 vv( 16 )=  -3.5737690684862660     
 vv( 17 )=  -4.2481178735681269     
 vv( 18 )=  -5.0483640088744668     
 ww(  1 )=  7.82819977211581424D-012
 ww(  2 )=  1.04672057957919054D-008
 ww(  3 )=  1.81065448109340574D-006
 ww(  4 )=  9.18112686792931209D-005
 ww(  5 )=  1.88852263026840421D-003
 ww(  6 )=  1.86400423875444886D-002
 ww(  7 )=  9.73017476413144539D-002
 ww(  8 )=  0.28480728566997687     
 ww(  9 )=  0.48349569472545129     
 ww( 10 )=  0.48349569472545129     
 ww( 11 )=  0.28480728566997687     
 ww( 12 )=  9.73017476413144539D-002
 ww( 13 )=  1.86400423875444886D-002
 ww( 14 )=  1.88852263026840421D-003
 ww( 15 )=  9.18112686792931209D-005
 ww( 16 )=  1.81065448109340574D-006
 ww( 17 )=  1.04672057957919054D-008
 ww( 18 )=  7.82819977211581424D-012
  elseif (Nq.EQ.19) then
vv(  1 )=   5.2202716905374817     
 vv(  2 )=   4.4285328066037790     
 vv(  3 )=   3.7621873519640201     
 vv(  4 )=   3.1578488183476021     
 vv(  5 )=   2.5911337897945428     
 vv(  6 )=   2.0492317098506194     
 vv(  7 )=   1.5241706193935329     
 vv(  8 )=   1.0103683871343114     
 vv(  9 )=  0.50352016342388817     
 vv( 10 )=   0.0000000000000000     
 vv( 11 )= -0.50352016342388817     
 vv( 12 )=  -1.0103683871343114     
 vv( 13 )=  -1.5241706193935329     
 vv( 14 )=  -2.0492317098506194     
 vv( 15 )=  -2.5911337897945428     
 vv( 16 )=  -3.1578488183476021     
 vv( 17 )=  -3.7621873519640201     
 vv( 18 )=  -4.4285328066037790     
 vv( 19 )=  -5.2202716905374817     
 ww(  1 )=  1.32629709449848683D-012
 ww(  2 )=  2.16305100986351483D-009
 ww(  3 )=  4.48824314722308719D-007
 ww(  4 )=  2.72091977631614173D-005
 ww(  5 )=  6.70877521407173467D-004
 ww(  6 )=  7.98886677772291456D-003
 ww(  7 )=  5.08103869090516594D-002
 ww(  8 )=  0.18363270130699538     
 ww(  9 )=  0.39160898861302640     
 ww( 10 )=  0.50297488827618764     
 ww( 11 )=  0.39160898861302640     
 ww( 12 )=  0.18363270130699538     
 ww( 13 )=  5.08103869090516594D-002
 ww( 14 )=  7.98886677772291456D-003
 ww( 15 )=  6.70877521407173467D-004
 ww( 16 )=  2.72091977631614173D-005
 ww( 17 )=  4.48824314722308719D-007
 ww( 18 )=  2.16305100986351483D-009
 ww( 19 )=  1.32629709449848683D-012
  elseif (Nq.EQ.20) then
 vv(  1 )=   5.3874808900112328     
 vv(  2 )=   4.6036824495507442     
 vv(  3 )=   3.9447640401156252     
 vv(  4 )=   3.3478545673832163     
 vv(  5 )=   2.7888060584281305     
 vv(  6 )=   2.2549740020892757     
 vv(  7 )=   1.7385377121165861     
 vv(  8 )=   1.2340762153953231     
 vv(  9 )=  0.73747372854539439     
 vv( 10 )=  0.24534070830090127     
 vv( 11 )= -0.24534070830090127     
 vv( 12 )= -0.73747372854539439     
 vv( 13 )=  -1.2340762153953231     
 vv( 14 )=  -1.7385377121165861     
 vv( 15 )=  -2.2549740020892757     
 vv( 16 )=  -2.7888060584281305     
 vv( 17 )=  -3.3478545673832163     
 vv( 18 )=  -3.9447640401156252     
 vv( 19 )=  -4.6036824495507442     
 vv( 20 )=  -5.3874808900112328     
 ww(  1 )=  2.22939364553413890D-013
 ww(  2 )=  4.39934099227314267D-010
 ww(  3 )=  1.08606937076927278D-007
 ww(  4 )=  7.80255647853199042D-006
 ww(  5 )=  2.28338636016351017D-004
 ww(  6 )=  3.24377334223782589D-003
 ww(  7 )=  2.48105208874634039D-002
 ww(  8 )=  0.10901720602002224     
 ww(  9 )=  0.28667550536283143     
 ww( 10 )=  0.46224366960060548     
 ww( 11 )=  0.46224366960060548     
 ww( 12 )=  0.28667550536283143     
 ww( 13 )=  0.10901720602002224     
 ww( 14 )=  2.48105208874634039D-002
 ww( 15 )=  3.24377334223782589D-003
 ww( 16 )=  2.28338636016351017D-004
 ww( 17 )=  7.80255647853199042D-006
 ww( 18 )=  1.08606937076927278D-007
 ww( 19 )=  4.39934099227314267D-010
 ww( 20 )=  2.22939364553413890D-013
  else
     print*,'error from LIMBES_dvm: SIMUL_Nquad must be between 3 and 20'
     print*,'SIMUL_Nquad=',Nq
  endif

end subroutine GaussHermite









